﻿/**
 *
 * net.h
 *
 *  Created on: 2019-11-27
 *      Author: chenshisheng
 */

#ifndef NET_H_
#define NET_H_

#include "main.h"
#include "message_queue.h"
#include "shell.h"

// Lifetime时长（秒）
#define NET_LIFETIME (60 * 60 * 24)

typedef enum
{
    Net_Resource_TotalWeight,
    Net_Resource_InputWeight,
    Net_Resource_IsDoorOpened,
    Net_Resource_OpenDoor,
    Net_Resource_IsFull,
    Net_Resource_IsSensorNormal,
    Net_Resource_Battery,

    Net_Resource_Max
}Net_Resource_t;

void Net_Init(void);
void Net_StartNotify(void);
void Net_MiplUpdate(int lifetime);
int Net_NotifyAbortCmd(Stream_t *stream, int argc, char *argv[]);
void Net_OnMiplEvent(const MsgQueue_Msg_t *msg);
void Net_OnMiplDiscoverObj(const MsgQueue_Msg_t *msg);

#endif /* NET_H_ */
